import com.bit.utils.FileUtils;
import user.AdminUser;
import user.NormalUser;
import user.ProxyUser;
import user.User;
import user.factory.AdminUserFactory;
import user.factory.IUserFactory;
import user.factory.NormalUserFactory;

public class LibrarySystem {
    public static void main(String[] args) {
        //工厂模式
        IUserFactory adminUserFactory = new AdminUserFactory();
        User adminUser = adminUserFactory.createrUesr("叶叶",1);
        IUserFactory normalUserFactory = new NormalUserFactory();
        User normalUser1 = normalUserFactory.createrUesr("飞飞",2);
        User normalUser2 = normalUserFactory.createrUesr("小凯",3);

        //代理模式来控制对象的访问
        ProxyUser proxyUserAdmin = new ProxyUser(adminUser);
        ProxyUser proxyUserNormal1 = new ProxyUser(normalUser1);
        ProxyUser proxyUserNormal2 = new ProxyUser(normalUser2);
    }

    public static void main1(String[] args) {
        //直接创建管理员
        User adminUser = new AdminUser("叶叶",1);
        //直接创建普通用户
        User normalUser1 = new NormalUser("飞飞",2);
        User normalUser2 = new NormalUser("小凯",3);

    }
}
